/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1638968490470_5151';

  // add your middleware config here
  config.middleware = [];

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  };
  // config/config.${env}.js
  config.mysql = {
    // 单数据库信息配置
    client: {
      // host
      host: 'localhost',
      // 端口号
      port: '3306',
      // 用户名
      user: 'broker',
      // 密码
      password: '123456',
      // 数据库名
      database: 'broker',
    },
    // 是否加载到 app 上，默认开启
    app: true,
    // 是否加载到 agent 上，默认关闭
    agent: false,
  };
  config.security = {
    csrf: false
  };
  config.middleware = ['token'];
  // config/config.default.js
  config.multipart = {
    mode: 'file'
  };

  // oss存储
  config.oss = {  // 这里需要的东西去自己的服务器里看，我用的阿里云
    client: {
      accessKeyId: "LTAI5tMxWqgHrjuMfvLUWjpX", //仓库id// 从STS服务获取的临时访问密钥（AccessKey ID和AccessKey Secret）。
      accessKeySecret: "VWAFBvY41FaCVZsyy0V7Tv0AMBIp5A",
      bucket: 'songshaopeng-agent',
      endpoint: 'oss-cn-hangzhou.aliyuncs.com',
      timeout: '60s',
    },
  }
  return {
    ...config,
    ...userConfig,
  };
};
